Currently, in most of image sensors, like Charge-Coupled Device (CCD) or Complementary Metal Oxide Semiconductor (CMOS), information of three primary colors (Red, Green and Blue) of an image may be recorded by using a color filter array which is referred to as Bayer filter. The Bayer filler pattern is quartet-ordered with successive rows that alternate red and green filters, then green and blue filters. Therefore, images output from the CCD or CMOS image sensors usually have a Bayer format.
Typically, pixels of an image in Bayer format may have four kinds of arrangement modes. Referring to FIG. 1, take the one on the top left corner as an example, pixels output in odd-numbered scanning lines have a format of RGRG . . . , and pixels output in even-numbered scanning lines have a format of GBGB . . . . Each pixel merely needs to output one kind of color component, as people are insensitive to changes in color. Accordingly, R, G, R, G . . . information are output when sampling pixels 1, 2, 3, 4, . . . in the odd-numbered scanning lines, while G, B, G, B . . . information are output when sampling pixels 1, 2, 3, 4, . . . in the even-numbered scanning lines. In practical operation. R, G, B components of a pixel may be composed of a specific color component of this pixel and other color components of its neighbor pixels. By using the sampling method described above, sampling frequency can be reduced above 60% without obvious quality degradation.
Compared with full-color format, transmission bandwidth and storage space can be saved when images are in Bayer format. However, images in Bayer format still needs to be processed in some cases, so as to further reduce size of the images. Currently, a binning process may be used for size reduction, in which pixels in a Bayer format image may be merged together.
In some embodiments, binning is a method for reading images, where the Binning may include: calculating a mean value of multiple neighboring pixels, and outputting the mean value as a new pixel. The binning process may be performed in a horizontal direction, or in a vertical direction, or in both horizontal and vertical directions. In this way, an image size may be reduced, and the volume of image data may be decreased. In addition, because the binning process use a mean value, which is calculated based on multiple pixels, to represent a pixel value of a new pixel, image noise can be suppressed to some extent.
A conventional binning process is schematically illustrated in FIG. 2. In FIG. 2, a two-to-one binning ratio (1/2 binning process) may be taken as an example to show the binning process, where R, G and B represent red pixels, green pixels and blue pixels, respectively. Numerals on the top represent horizontal coordinates, and numerals on the left represent vertical coordinates, both of which may be used to identify pixels in the drawing. The left drawing of FIG. 2 illustrates an original Bayer format image output by an image sensor. The right drawing of FIG. 2 illustrates a Bayer format image on which a 1/2 binning process has been performed in both horizontal and vertical directions. The pixel value of the red pixel (0, 0) in the right drawing is obtained by calculating a mean value of four red pixels in the original image, namely, [R(0,0)+R(0,2)+R(2,0)+R(2,2)]/4. The correspondence between these red pixels is shown with circles and arrows. Likewise, in the left drawing of FIG. 2, for the green pixels marked with a square, the green pixels marked with a triangle, or the blue pixels not marked, mean values of these pixels equal to pixels values of pixels marked in the same way in the right drawing of FIG. 2. Thus, after a binning process is finished, the original image having a 4×4 dimension is transformed into an image having a 2×2 dimension. It should be noted that the Bayer format (arrangement mode of pixels) of the image remains unchanged despite the binning process.
FIG. 3 schematically illustrates a conventional binning process in which a 1/2 binning is performed in a horizontal direction, where a pixel value of a pixel in the right drawing of FIG. 3 equals to a mean value of two neighboring pixels in the horizontal direction in the left original image. Referring to FIG. 3, a value of the first red pixel in the right drawing is calculated according to the formula: [R(0,0)+R(2,0)]/2. Therefore, a dimension in the horizontal direction of the image on which a binning process is performed, is a half of that of the original image, while a dimension in the vertical direction of the image on which a binning process is performed, remains unchanged.
FIG. 4 schematically illustrates a conventional binning process in which a 1/2 binning is performed in a vertical direction, where a pixel value of a pixel in the right drawing of FIG. 4 equals to a mean value of two neighboring pixels in the vertical direction in the left original image. Referring to FIG. 4, a value of the first red pixel in the right drawing is calculated according to the formula: [R(0,0)+R(0,2)]/2. Therefore, a dimension in the vertical direction of the image on which a binning process is performed, is a half of that of the original image, while a dimension in the horizontal direction of the image on which a binning process is performed, remains unchanged.
The principle of other binning processes having different binning ratios is similar to that of the 1/2 binning process. The difference is that more than two pixels may be used to calculate their mean value. Specifically, for 1/n binning process, values of n pixels in a certain direction of an original image are calculated to obtain a mean value. Thus, after a binning process is finished, an image dimension in a certain direction becomes 1/n of the original image.
However, the conventional binning process only adopts averaging method, which may cause false minutiae in the course of color interpolation and reduce image quality severely.